import request from '../components/util/request';
import api from './api.js';

const login = data => {
  return request({
    url: api.login,
    data: JSON.stringify(data),
    method: 'post'
  });
};

const register = data => {
  return request({
    url: api.register,
    data: JSON.stringify(data),
    method: 'post'
  });
};

const logout = () => {
  return request({
    url: api.userLogout,
    method: 'post'
  });
};

export {
  login, // 用户登录
  register, // 用户注册
  getUserInfo,
  logout
};
